package pro1.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import pro1.model.ResponseBody;
import pro1.service.LoginService;

@RestController
@RequestMapping("login")
public class LoginController {

	@Autowired
	LoginService loginService;

	/**
	 * 登陆
	 * 
	 * @param session
	 * @param userName
	 * @param pwd
	 * @return
	 */
	@PostMapping("login")
	public ResponseBody login(HttpSession session, @RequestParam("username") String userName,
			@RequestParam("pwd") String pwd, @RequestParam("type") Integer type) {
		return loginService.login(session, userName, pwd, type);
	}

}
